namespace CIS
{
    using CISLib;
    using ComponentArt.Web.UI;
    using System;
    using System.Web.UI;

    public class TreeView : Page
    {
        protected ComponentArt.Web.UI.TreeView MyTreeView;
        protected UserPrincipal Principal = null;

        private void BuildAdminTree(TreeViewNode tvnRoot, SysUser sysUser)
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/LanguageConfig.xml");
            TreeViewNode TvnProductManage = new TreeViewNode();
            TvnProductManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProductManage", language, path);
            TvnProductManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProductManage", language, path);
            TvnProductManage.NavigateUrl = "ProductManagePage.aspx";
            TvnProductManage.ImageUrl = "images/TreeView/板头ICON.gif";
            tvnRoot.Nodes.Add(TvnProductManage);
            TreeViewNode TvnUserManage = new TreeViewNode();
            TvnUserManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserManage", language, path);
            TvnUserManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserManage", language, path);
            TvnUserManage.NavigateUrl = "UserManage.aspx";
            TvnUserManage.ImageUrl = "images/TreeView/用户管理.gif";
            tvnRoot.Nodes.Add(TvnUserManage);
            TreeViewNode TvnProvinceManage = new TreeViewNode();
            if (this.Principal.OwnArea[0].AreaId.ToString() == "a7f26634-10a9-4cb1-aa2c-8c91a8dfdd66")
            {
                TvnProvinceManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManageOverSea", language, path);
                TvnProvinceManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManageOverSea", language, path);
            }
            else
            {
                TvnProvinceManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManage", language, path);
                TvnProvinceManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManage", language, path);
            }
            TvnProvinceManage.NavigateUrl = "ProvinceManage.aspx";
            TvnProvinceManage.ImageUrl = "Images/TreeView/区域管理.gif";
            tvnRoot.Nodes.Add(TvnProvinceManage);
            TreeViewNode TvnCityManage = new TreeViewNode();
            if (this.Principal.OwnArea[0].AreaId.ToString() == "a7f26634-10a9-4cb1-aa2c-8c91a8dfdd66")
            {
                TvnCityManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManageOverSea", language, path);
                TvnCityManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManageOverSea", language, path);
            }
            else
            {
                TvnCityManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManage", language, path);
                TvnCityManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManage", language, path);
            }
            TvnCityManage.NavigateUrl = "CityManage.aspx";
            TvnCityManage.ImageUrl = "Images/TreeView/县市管理.gif";
            tvnRoot.Nodes.Add(TvnCityManage);
            TreeViewNode TvnCATManage = new TreeViewNode();
            TvnCATManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCATManage", language, path);
            TvnCATManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCATManage", language, path);
            TvnCATManage.NavigateUrl = "CATManage.aspx";
            TvnCATManage.ImageUrl = "Images/TreeView/CAT管理.gif";
            tvnRoot.Nodes.Add(TvnCATManage);
            TreeViewNode TvnRoleManage = new TreeViewNode();
            TvnRoleManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnRoleManage", language, path);
            TvnRoleManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnRoleManage", language, path);
            TvnRoleManage.NavigateUrl = "RoleManage.aspx";
            TvnRoleManage.ImageUrl = "Images/TreeView/角色管理.gif";
            tvnRoot.Nodes.Add(TvnRoleManage);
            TreeViewNode TvnCustomerDefManage = new TreeViewNode();
            TvnCustomerDefManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerDefManage", language, path);
            TvnCustomerDefManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerDefManage", language, path);
            TvnCustomerDefManage.NavigateUrl = "CustomerDefine.aspx";
            TvnCustomerDefManage.ImageUrl = "Images/TreeView/客户定义管理.gif";
            tvnRoot.Nodes.Add(TvnCustomerDefManage);
            TreeViewNode TvnPreManage = new TreeViewNode();
            TvnPreManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPreManage", language, path);
            TvnPreManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPreManage", language, path);
            TvnPreManage.NavigateUrl = "PreferenceManage.aspx";
            TvnPreManage.ImageUrl = "Images/TreeView/喜好管理.gif";
            tvnRoot.Nodes.Add(TvnPreManage);
            TreeViewNode TvnLogManage = new TreeViewNode();
            TvnLogManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnLogManage", language, path);
            TvnLogManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnLogManage", language, path);
            TvnLogManage.NavigateUrl = "LogManagePage.aspx";
            TvnLogManage.ImageUrl = "Images/TreeView/日志管理.gif";
            tvnRoot.Nodes.Add(TvnLogManage);
            TreeViewNode TvnAnnounce = new TreeViewNode();
            TvnAnnounce.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAnnounce", language, path);
            TvnAnnounce.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAnnounce", language, path);
            TvnAnnounce.NavigateUrl = "AnnounceManagePage.aspx";
            TvnAnnounce.ImageUrl = "Images/TreeView/公告栏管理.gif";
            tvnRoot.Nodes.Add(TvnAnnounce);
            TreeViewNode TvnSetCustomerBelong = new TreeViewNode();
            TvnSetCustomerBelong.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSetCustomerBelong", language, path);
            TvnSetCustomerBelong.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSetCustomerBelong", language, path);
            TvnSetCustomerBelong.NavigateUrl = "UserCustomerSetPage.aspx";
            TvnSetCustomerBelong.ImageUrl = "Images/TreeView/设置客户编辑对象.gif";
            tvnRoot.Nodes.Add(TvnSetCustomerBelong);
            TreeViewNode TvnCustomerCount = new TreeViewNode();
            TvnCustomerCount.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerCount", language, path);
            TvnCustomerCount.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerCount", language, path);
            TvnCustomerCount.NavigateUrl = "CustomerInfoCountPage.aspx";
            TvnCustomerCount.ImageUrl = "Images/TreeView/客户信息查询.gif";
            tvnRoot.Nodes.Add(TvnCustomerCount);
            TreeViewNode TvnResourceCount = new TreeViewNode();
            TvnResourceCount.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceCount", language, path);
            TvnResourceCount.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceCount", language, path);
            TvnResourceCount.NavigateUrl = "ResourceInfoCountPage.aspx";
            TvnResourceCount.ImageUrl = "Images/TreeView/共享辅助信息统计.gif";
            tvnRoot.Nodes.Add(TvnResourceCount);
            TreeViewNode TvnAdminApply = new TreeViewNode();
            TvnAdminApply.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdminApply", language, path);
            TvnAdminApply.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdminApply", language, path);
            TvnAdminApply.NavigateUrl = "AdminApplication.aspx";
            TvnAdminApply.ImageUrl = "Images/TreeView/权限申请.gif";
            tvnRoot.Nodes.Add(TvnAdminApply);
            TreeViewNode TvnAdvice = new TreeViewNode();
            TvnAdvice.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.NavigateUrl = "AdvicePage.aspx";
            TvnAdvice.ImageUrl = "Images/TreeView/意见箱.gif";
            tvnRoot.Nodes.Add(TvnAdvice);
            TreeViewNode TvnMail = new TreeViewNode();
            TvnMail.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMail", language, path);
            TvnMail.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMail", language, path);
            TvnMail.ImageUrl = "Images/email.gif";
            tvnRoot.Nodes.Add(TvnMail);
            TreeViewNode TvnMailConfig = new TreeViewNode();
            TvnMailConfig.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailConfig", language, path);
            TvnMailConfig.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailConfig", language, path);
            TvnMailConfig.NavigateUrl = "Mail/MailConfig.aspx";
            TvnMailConfig.ImageUrl = "Images/mailbox.gif";
            TvnMail.Nodes.Add(TvnMailConfig);
            TreeViewNode TvnMailSend = new TreeViewNode();
            TvnMailSend.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailSend", language, path);
            TvnMailSend.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailSend", language, path);
            TvnMailSend.NavigateUrl = "Mail/SendMail.aspx";
            TvnMailSend.ImageUrl = "Images/email.gif";
            TvnMail.Nodes.Add(TvnMailSend);
            TreeViewNode TvnUserCheck = new TreeViewNode();
            TvnUserCheck.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserCheck", language, path);
            TvnUserCheck.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserCheck", language, path);
            TvnUserCheck.NavigateUrl = "UserCheck/CheckUserPage.aspx";
            TvnUserCheck.ImageUrl = "Images/TreeView/意见箱.gif";
            tvnRoot.Nodes.Add(TvnUserCheck);
        }

        private void BuildCInfoTree(TreeViewNode tvnRoot, SysUser sysUser)
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/LanguageConfig.xml");
            TreeViewNode TvnResourceHotel = new TreeViewNode();
            TvnResourceHotel.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceHotel", language, path);
            TvnResourceHotel.ToolTip = "";
            TvnResourceHotel.NavigateUrl = "~/Resource/ResourceHotelPage.aspx";
            TvnResourceHotel.ImageUrl = "Images/TreeView/协议酒店信息.gif";
            tvnRoot.Nodes.Add(TvnResourceHotel);
            TreeViewNode TvnResourceRestaurant = new TreeViewNode();
            TvnResourceRestaurant.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceRestaurant", language, path);
            TvnResourceRestaurant.ToolTip = "";
            TvnResourceRestaurant.NavigateUrl = "~/Resource/ResourceRestaurantPage.aspx";
            TvnResourceRestaurant.ImageUrl = "Images/TreeView/推荐餐饮信息.gif";
            tvnRoot.Nodes.Add(TvnResourceRestaurant);
            TreeViewNode TvnResourceEntertainment = new TreeViewNode();
            TvnResourceEntertainment.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceEntertainment", language, path);
            TvnResourceEntertainment.ToolTip = "";
            TvnResourceEntertainment.NavigateUrl = "~/Resource/ResourceEntertainmentPage.aspx";
            TvnResourceEntertainment.ImageUrl = "Images/TreeView/休闲娱乐.gif";
            tvnRoot.Nodes.Add(TvnResourceEntertainment);
            TreeViewNode TvnResourceAgencies = new TreeViewNode();
            TvnResourceAgencies.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceAgencies", language, path);
            TvnResourceAgencies.ToolTip = "";
            TvnResourceAgencies.NavigateUrl = "~/Resource/ResourceAgenciesPage.aspx";
            TvnResourceAgencies.ImageUrl = "Images/TreeView/服务代理.gif";
            tvnRoot.Nodes.Add(TvnResourceAgencies);
            TreeViewNode TvnResourceHospitals = new TreeViewNode();
            TvnResourceHospitals.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceHospitals", language, path);
            TvnResourceHospitals.ToolTip = "";
            TvnResourceHospitals.NavigateUrl = "~/Resource/ResourceHospitalPage.aspx";
            TvnResourceHospitals.ImageUrl = "Images/TreeView/医院.gif";
            tvnRoot.Nodes.Add(TvnResourceHospitals);
            TreeViewNode TvnResourceHoliday = new TreeViewNode();
            TvnResourceHoliday.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceHoliday", language, path);
            TvnResourceHoliday.ToolTip = "";
            TvnResourceHoliday.NavigateUrl = "~/Resource/ResourceHolidayPage.aspx";
            TvnResourceHoliday.ImageUrl = "Images/TreeView/特色节日.gif";
            tvnRoot.Nodes.Add(TvnResourceHoliday);
            TreeViewNode TvnResourceEvents = new TreeViewNode();
            TvnResourceEvents.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceEvents", language, path);
            TvnResourceEvents.ToolTip = "";
            TvnResourceEvents.NavigateUrl = "~/Resource/ResourceEventsPage.aspx";
            TvnResourceEvents.ImageUrl = "Images/TreeView/展览与活动.gif";
            tvnRoot.Nodes.Add(TvnResourceEvents);
            TreeViewNode TvnResourceTelephone = new TreeViewNode();
            TvnResourceTelephone.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceTelephone", language, path);
            TvnResourceTelephone.ToolTip = "";
            TvnResourceTelephone.NavigateUrl = "~/Resource/ResourceTelephonePage.aspx";
            TvnResourceTelephone.ImageUrl = "Images/TreeView/常用电话.gif";
            tvnRoot.Nodes.Add(TvnResourceTelephone);
            TreeViewNode TvnResourceDirectory = new TreeViewNode();
            TvnResourceDirectory.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceDirectory", language, path);
            TvnResourceDirectory.ToolTip = "";
            TvnResourceDirectory.NavigateUrl = "~/Resource/ResourceDirectoryPage.aspx";
            TvnResourceDirectory.ImageUrl = "Images/TreeView/分公司通讯录ICON.gif";
            tvnRoot.Nodes.Add(TvnResourceDirectory);
            TreeViewNode TvnResourceOther = new TreeViewNode();
            TvnResourceOther.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceOther", language, path);
            TvnResourceOther.ToolTip = "";
            TvnResourceOther.NavigateUrl = "~/Resource/ResourceOtherPage.aspx";
            TvnResourceOther.ImageUrl = "Images/TreeView/其他信息.gif";
            tvnRoot.Nodes.Add(TvnResourceOther);
        }

        private void BuildGeneralTree(SysUser sysUser)
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/LanguageConfig.xml");
            TreeViewNode TvnRoot = new TreeViewNode();
            TvnRoot.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnRoot", language, path);
            TvnRoot.NavigateUrl = "MainPage.aspx";
            TvnRoot.ImageUrl = "Images/TreeView/主页.gif";
            TvnRoot.Expanded = true;
            this.MyTreeView.Nodes.Add(TvnRoot);
            TreeViewNode TvnBasicInfo = new TreeViewNode();
            TvnBasicInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnBasicInfo", language, path);
            TvnBasicInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnBasicInfo", language, path);
            TvnBasicInfo.NavigateUrl = "CompanyInfo.aspx";
            TvnBasicInfo.ImageUrl = "Images/TreeView/基础信息.gif";
            TvnRoot.Nodes.Add(TvnBasicInfo);
            TreeViewNode TvnPersonalInfo = new TreeViewNode();
            TvnPersonalInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPersonalInfo", language, path);
            TvnPersonalInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPersonalInfo", language, path);
            TvnPersonalInfo.NavigateUrl = "~/Customer/CustomerInfoListPage.aspx";
            TvnPersonalInfo.ImageUrl = "Images/TreeView/个人信息.gif";
            TvnRoot.Nodes.Add(TvnPersonalInfo);
            if (this.Principal.OwnArea.Length > 1)
            {
                TreeViewNode TvnProjectInfo = new TreeViewNode();
                TvnProjectInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProjectInfo", language, path);
                TvnProjectInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProjectInfo", language, path);
                TvnProjectInfo.NavigateUrl = "CompanyInfo.aspx?Type=ProjectInfo";
                TvnProjectInfo.ImageUrl = "Images/TreeView/项目信息.gif";
                TvnRoot.Nodes.Add(TvnProjectInfo);
            }
            else if (this.Principal.OwnArea[0].AreaId.ToString() == "A7F26634-10A9-4CB1-AA2C-8C91A8DFDD66")
            {
                TreeViewNode TvnProjectInfo = new TreeViewNode();
                TvnProjectInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProjectInfo", language, path);
                TvnProjectInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProjectInfo", language, path);
                TvnProjectInfo.NavigateUrl = "CompanyInfo.aspx?Type=ProjectInfo";
                TvnProjectInfo.ImageUrl = "Images/TreeView/项目信息.gif";
                TvnRoot.Nodes.Add(TvnProjectInfo);
            }
            TreeViewNode TvnSearchInfo = new TreeViewNode();
            TvnSearchInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchInfo", language, path);
            TvnSearchInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchInfo", language, path);
            TvnSearchInfo.ImageUrl = "Images/TreeView/信息查询.gif";
            TvnRoot.Nodes.Add(TvnSearchInfo);
            TreeViewNode TvnSearchBBasicInfo = new TreeViewNode();
            TvnSearchBBasicInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchBBasicInfo", language, path);
            TvnSearchBBasicInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchBBasicInfo", language, path);
            TvnSearchBBasicInfo.NavigateUrl = "~/Customer/CustomerInfoBasicSearch.aspx";
            TvnSearchBBasicInfo.ImageUrl = "Images/TreeView/客户信息查询.gif";
            TvnSearchInfo.Nodes.Add(TvnSearchBBasicInfo);
            TreeViewNode TvnSearchBInfo = new TreeViewNode();
            TvnSearchBInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchAInfo", language, path);
            TvnSearchBInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchAInfo", language, path);
            TvnSearchBInfo.NavigateUrl = "~/Customer/CustomerInfoSearchPage.aspx";
            TvnSearchBInfo.ImageUrl = "Images/TreeView/客户信息查询.gif";
            TvnSearchInfo.Nodes.Add(TvnSearchBInfo);
            TreeViewNode TvnSearchCInfo = new TreeViewNode();
            TvnSearchCInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchBInfo", language, path);
            TvnSearchCInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSearchBInfo", language, path);
            TvnSearchCInfo.NavigateUrl = "~/Resource/ResourceSearchPage.aspx";
            TvnSearchCInfo.ImageUrl = "Images/TreeView/资源信息查询.gif";
            TvnSearchInfo.Nodes.Add(TvnSearchCInfo);
            TreeViewNode TvnShareResourceInfo = new TreeViewNode();
            TvnShareResourceInfo.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnShareResourceInfo", language, path);
            TvnShareResourceInfo.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnShareResourceInfo", language, path);
            TvnShareResourceInfo.NavigateUrl = "";
            TvnShareResourceInfo.ImageUrl = "Images/TreeView/共享辅助信息.gif";
            TvnRoot.Nodes.Add(TvnShareResourceInfo);
            this.BuildCInfoTree(TvnShareResourceInfo, sysUser);
            TreeViewNode TvnResourceTip = new TreeViewNode();
            TvnResourceTip.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceTip", language, path);
            TvnResourceTip.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceTip", language, path);
            TvnResourceTip.NavigateUrl = "~/Resource/ResourceTipPage.aspx";
            TvnResourceTip.ImageUrl = "Images/TreeView/销售小技巧.gif";
            TvnRoot.Nodes.Add(TvnResourceTip);
            TreeViewNode TvnApply = new TreeViewNode();
            TvnApply.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnApply", language, path);
            TvnApply.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnApply", language, path);
            TvnApply.NavigateUrl = "CustomerApplication.aspx";
            TvnApply.ImageUrl = "Images/TreeView/权限申请.gif";
            TvnRoot.Nodes.Add(TvnApply);
            TreeViewNode TvnAdvice = new TreeViewNode();
            TvnAdvice.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.NavigateUrl = "AdvicePage.aspx";
            TvnAdvice.ImageUrl = "Images/TreeView/意见箱.gif";
            TvnRoot.Nodes.Add(TvnAdvice);
            if (sysUser.IsAdmin == 1)
            {
                TreeViewNode TvnAdmin = new TreeViewNode();
                TvnAdmin.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdmin", language, path);
                TvnAdmin.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdmin", language, path);
                TvnAdmin.NavigateUrl = "";
                TvnAdmin.ImageUrl = "Images/TreeView/Admin.gif";
                TvnRoot.Nodes.Add(TvnAdmin);
                this.BuildAdminTree(TvnAdmin, sysUser);
            }
            else if (sysUser.IsAdmin == 2)
            {
                TreeViewNode TvnAdmin = new TreeViewNode();
                TvnAdmin.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdmin", language, path);
                TvnAdmin.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdmin", language, path);
                TvnAdmin.NavigateUrl = "";
                TvnAdmin.ImageUrl = "Images/TreeView/Admin.gif";
                TvnRoot.Nodes.Add(TvnAdmin);
                this.BuildSuperAdminTree(TvnAdmin, sysUser);
            }
        }

        private void BuildSuperAdminTree(TreeViewNode tvnRoot, SysUser sysUser)
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/LanguageConfig.xml");
            TreeViewNode TvnProductManage = new TreeViewNode();
            TvnProductManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProductManage", language, path);
            TvnProductManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProductManage", language, path);
            TvnProductManage.NavigateUrl = "ProductManagePage.aspx";
            TvnProductManage.ImageUrl = "images/TreeView/板头ICON.gif";
            tvnRoot.Nodes.Add(TvnProductManage);
            TreeViewNode TvnUserManage = new TreeViewNode();
            TvnUserManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserManage", language, path);
            TvnUserManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserManage", language, path);
            TvnUserManage.NavigateUrl = "UserManage.aspx";
            TvnUserManage.ImageUrl = "images/TreeView/用户管理.gif";
            tvnRoot.Nodes.Add(TvnUserManage);
            TreeViewNode TvnAreaManage = new TreeViewNode();
            TvnAreaManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAreaManage", language, path);
            TvnAreaManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAreaManage", language, path);
            TvnAreaManage.NavigateUrl = "AreaManage.aspx";
            TvnAreaManage.ImageUrl = "Images/TreeView/直辖市管理.gif";
            tvnRoot.Nodes.Add(TvnAreaManage);
            TreeViewNode TvnProvinceManage = new TreeViewNode();
            if (this.Principal.OwnArea[0].AreaId.ToString() == "a7f26634-10a9-4cb1-aa2c-8c91a8dfdd66")
            {
                TvnProvinceManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManageOverSea", language, path);
                TvnProvinceManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManageOverSea", language, path);
            }
            else
            {
                TvnProvinceManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManage", language, path);
                TvnProvinceManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnProvinceManage", language, path);
            }
            TvnProvinceManage.NavigateUrl = "ProvinceManage.aspx";
            TvnProvinceManage.ImageUrl = "Images/TreeView/区域管理.gif";
            tvnRoot.Nodes.Add(TvnProvinceManage);
            TreeViewNode TvnCityManage = new TreeViewNode();
            if (this.Principal.OwnArea[0].AreaId.ToString() == "a7f26634-10a9-4cb1-aa2c-8c91a8dfdd66")
            {
                TvnCityManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManageOverSea", language, path);
                TvnCityManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManageOverSea", language, path);
            }
            else
            {
                TvnCityManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManage", language, path);
                TvnCityManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCityManage", language, path);
            }
            TvnCityManage.NavigateUrl = "CityManage.aspx";
            TvnCityManage.ImageUrl = "Images/TreeView/县市管理.gif";
            tvnRoot.Nodes.Add(TvnCityManage);
            TreeViewNode TvnCATManage = new TreeViewNode();
            TvnCATManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCATManage", language, path);
            TvnCATManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCATManage", language, path);
            TvnCATManage.NavigateUrl = "CATManage.aspx";
            TvnCATManage.ImageUrl = "Images/TreeView/CAT管理.gif";
            tvnRoot.Nodes.Add(TvnCATManage);
            TreeViewNode TvnRoleManage = new TreeViewNode();
            TvnRoleManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnRoleManage", language, path);
            TvnRoleManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnRoleManage", language, path);
            TvnRoleManage.NavigateUrl = "RoleManage.aspx";
            TvnRoleManage.ImageUrl = "Images/TreeView/角色管理.gif";
            tvnRoot.Nodes.Add(TvnRoleManage);
            TreeViewNode TvnCustomerDefManage = new TreeViewNode();
            TvnCustomerDefManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerDefManage", language, path);
            TvnCustomerDefManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerDefManage", language, path);
            TvnCustomerDefManage.NavigateUrl = "CustomerDefine.aspx";
            TvnCustomerDefManage.ImageUrl = "Images/TreeView/客户定义管理.gif";
            tvnRoot.Nodes.Add(TvnCustomerDefManage);
            TreeViewNode TvnPreManage = new TreeViewNode();
            TvnPreManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPreManage", language, path);
            TvnPreManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnPreManage", language, path);
            TvnPreManage.NavigateUrl = "PreferenceManage.aspx";
            TvnPreManage.ImageUrl = "Images/TreeView/喜好管理.gif";
            tvnRoot.Nodes.Add(TvnPreManage);
            TreeViewNode TvnLogManage = new TreeViewNode();
            TvnLogManage.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnLogManage", language, path);
            TvnLogManage.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnLogManage", language, path);
            TvnLogManage.NavigateUrl = "LogManagePage.aspx";
            TvnLogManage.ImageUrl = "Images/TreeView/日志管理.gif";
            tvnRoot.Nodes.Add(TvnLogManage);
            TreeViewNode TvnAnnounce = new TreeViewNode();
            TvnAnnounce.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAnnounce", language, path);
            TvnAnnounce.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAnnounce", language, path);
            TvnAnnounce.NavigateUrl = "AnnounceManagePage.aspx";
            TvnAnnounce.ImageUrl = "Images/TreeView/公告栏管理.gif";
            tvnRoot.Nodes.Add(TvnAnnounce);
            TreeViewNode TvnSetCustomerBelong = new TreeViewNode();
            TvnSetCustomerBelong.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSetCustomerBelong", language, path);
            TvnSetCustomerBelong.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnSetCustomerBelong", language, path);
            TvnSetCustomerBelong.NavigateUrl = "UserCustomerSetPage.aspx";
            TvnSetCustomerBelong.ImageUrl = "Images/TreeView/设置客户编辑对象.gif";
            tvnRoot.Nodes.Add(TvnSetCustomerBelong);
            TreeViewNode TvnCustomerCount = new TreeViewNode();
            TvnCustomerCount.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerCount", language, path);
            TvnCustomerCount.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnCustomerCount", language, path);
            TvnCustomerCount.NavigateUrl = "CustomerInfoCountPage.aspx";
            TvnCustomerCount.ImageUrl = "Images/TreeView/客户信息查询.gif";
            tvnRoot.Nodes.Add(TvnCustomerCount);
            TreeViewNode TvnResourceCount = new TreeViewNode();
            TvnResourceCount.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceCount", language, path);
            TvnResourceCount.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnResourceCount", language, path);
            TvnResourceCount.NavigateUrl = "ResourceInfoCountPage.aspx";
            TvnResourceCount.ImageUrl = "Images/TreeView/共享辅助信息统计.gif";
            tvnRoot.Nodes.Add(TvnResourceCount);
            TreeViewNode TvnAdminApply = new TreeViewNode();
            TvnAdminApply.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdminApply", language, path);
            TvnAdminApply.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdminApply", language, path);
            TvnAdminApply.NavigateUrl = "AdminApplication.aspx";
            TvnAdminApply.ImageUrl = "Images/TreeView/权限申请.gif";
            tvnRoot.Nodes.Add(TvnAdminApply);
            TreeViewNode TvnAdvice = new TreeViewNode();
            TvnAdvice.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnAdvice", language, path);
            TvnAdvice.NavigateUrl = "AdvicePage.aspx";
            TvnAdvice.ImageUrl = "Images/TreeView/意见箱.gif";
            tvnRoot.Nodes.Add(TvnAdvice);
            TreeViewNode TvnMail = new TreeViewNode();
            TvnMail.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMail", language, path);
            TvnMail.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMail", language, path);
            TvnMail.ImageUrl = "Images/email.gif";
            tvnRoot.Nodes.Add(TvnMail);
            TreeViewNode TvnMailConfig = new TreeViewNode();
            TvnMailConfig.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailConfig", language, path);
            TvnMailConfig.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailConfig", language, path);
            TvnMailConfig.NavigateUrl = "Mail/MailConfig.aspx";
            TvnMailConfig.ImageUrl = "Images/mailbox.gif";
            TvnMail.Nodes.Add(TvnMailConfig);
            TreeViewNode TvnMailSend = new TreeViewNode();
            TvnMailSend.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailSend", language, path);
            TvnMailSend.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnMailSend", language, path);
            TvnMailSend.NavigateUrl = "Mail/SendMail.aspx";
            TvnMailSend.ImageUrl = "Images/email.gif";
            TvnMail.Nodes.Add(TvnMailSend);
            TreeViewNode TvnUserCheck = new TreeViewNode();
            TvnUserCheck.Text = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserCheck", language, path);
            TvnUserCheck.ToolTip = ManageSystemConfig.GetSystemSetLanguage("TreeView", "TvnUserCheck", language, path);
            TvnUserCheck.NavigateUrl = "UserCheck/CheckUserPage.aspx";
            TvnUserCheck.ImageUrl = "Images/TreeView/意见箱.gif";
            tvnRoot.Nodes.Add(TvnUserCheck);
        }

        private void InitializeComponent()
        {
            base.Load += new EventHandler(this.Page_Load);
        }

        protected override void OnInit(EventArgs e)
        {
            this.InitializeComponent();
            base.OnInit(e);
            this.Principal = this.Context.User as UserPrincipal;
        }

        private void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                this.MyTreeView.DragAndDropEnabled = false;
                this.BuildGeneralTree(this.Principal.SysUser);
            }
        }

        private void SetFrom()
        {
            string language = this.Session["language"].ToString();
            string path = base.Server.MapPath("~/LanguageConfig.xml");
        }
    }
}

